<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'product-category-form',
	'enableAjaxValidation'=>false,
        'htmlOptions' => array(
            "class" => "mainForm", 
            'enctype' => 'multipart/form-data',
        ),
)); ?>
<fieldset>
    <div class="widget first">
        <div class="head"><h5 class="iList"><?php echo $actionName . " Product Category " . $model->name; ?></h5></div>
        <div class="rowElem">
            <?php echo $form->labelEx($model, 'name'); ?>
            <div class="formRight"><?php echo $form->textField($model, 'name', array('size' => 60, 'maxlength' => 255, "class" => "rightDir", "title" => "Name")); ?></div>
            <?php echo $form->error($model, 'name', array("style" => "color:red")); ?>
            <div class="fix"></div>
        </div>
        <div class="rowElem">
            <?php echo $form->labelEx($model, 'description'); ?>
            <div class="formRight"><?php echo CHtml::activeTextArea($model, 'description', array("rows"=> Constant::FORM_TEXTAREA_ROW, "class"=>"rightDir", "title"=>"Description")); ?></div>
            <?php echo $form->error($model, 'description', array("style" => "color:red")); ?>
            <div class="fix"></div>
        </div>
        <div class="rowElem">
            <?php echo $form->labelEx($model, 'parentId'); ?>
            <div class="formRight"><?php echo CHtml::activeDropDownList($model, 'parentId', ProductCategory::getAllParentCategoriesTracking()); ?></div>
            <?php echo $form->error($model, 'parentId', array("style" => "color:red")); ?>
            <div class="fix"></div>
        </div>
	<div class="rowElem">
                <?php echo $form->labelEx($model, 'file_upload'); ?>
                <div class="formRight"> <?php echo CHtml::activeFileField($model, 'file_upload'); ?></div>
                <?php echo $form->error($model, 'file_upload', array("style"=>"color:red")); ?>
                <div class="formRight">
                <?php 
                if ($model->iconUrl)
                    echo CHtml::image( Yii::app()->request->baseUrl . "/../uploads/productcategories/" . $model->iconUrl,"",array("width"=>"150", "height"=>"150"));
                ?>
                </div>
                <div class="fix"></div>
            </div>

	 <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save', array("class" => "greyishBtn submitForm")); ?>
        <div class="fix"></div>
    </div>
</fieldset>
<?php $this->endWidget(); ?>
